<?php
if($act=="edittab")
{
    $sql_select = "select * from tbltourtab where iId=$id ";
    $tab        = $dbsql->query_fetch($sql_select);

    if($tab['cType']=="Image")
    {
        $sql_select = "select * from tblgallery where iParentId=".$tab['iId'];
        $listphotos = $dbsql->load($sql_select);
    }
}else
{
    $tab              = array();
    $tab['iParentId'] = $id;
    $tab['iStatus']   = 1;
}
?>